package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.ActivityScope;
import com.wgts.wgts.mvp.model.IPhoneLoginActivityModel;
import com.wgts.wgts.mvp.model.ISendSMSCodeModel;
import com.wgts.wgts.mvp.model.imp.PhoneLoginActivityModel;
import com.wgts.wgts.mvp.model.imp.SendSMSCodeModel;
import com.wgts.wgts.mvp.presenter.IPhoneLoginActivityPersenter;
import com.wgts.wgts.mvp.presenter.imp.PhoneLoginActivityPersenter;
import com.wgts.wgts.mvp.view.IPhoneLoginActivityView;
import com.wgts.wgts.netmodle.NetService;
import com.wgts.wgts.tools.CountDownTime;
import com.wgts.wgts.tools.SharedpreferencesHelper;

import dagger.Module;
import dagger.Provides;

@Module
public class PhoneLoginActivityModule {

    private IPhoneLoginActivityView view;

    public PhoneLoginActivityModule(IPhoneLoginActivityView view) {
        this.view = view;
    }

    @ActivityScope
    @Provides
    public IPhoneLoginActivityView provideView(){
        return view;
    }

    @ActivityScope
    @Provides
    public IPhoneLoginActivityModel provideModel(NetService netService, SharedpreferencesHelper sharedpreferencesHelper, CountDownTime countDownTime){
        return new PhoneLoginActivityModel(netService, sharedpreferencesHelper, countDownTime);
    }

    @ActivityScope
    @Provides
    public ISendSMSCodeModel provideSmsModel(NetService netService, CountDownTime countDownTime){
        return new SendSMSCodeModel(netService, countDownTime);
    }

    @ActivityScope
    @Provides
    public IPhoneLoginActivityPersenter providePersenter(IPhoneLoginActivityView view, IPhoneLoginActivityModel model, ISendSMSCodeModel sendSMSCodeModel){
        return new PhoneLoginActivityPersenter(view, model, sendSMSCodeModel);
    }
}
